package whf.framework.resource.thread;


/**
 * @author wanghaifeng
 *
 */
public abstract class AbstractPoolableThread extends Thread {
	/**
	 * 线程创建时间
	 */
	private long creationTime = System.currentTimeMillis();
	
	public boolean isTimeout(){
		long now = System.currentTimeMillis() - this.creationTime;
		return now > 1000 * 60 * 5; //1分钟超时
	}

	/**
	 * 超时时的动作处理,一般用于事务回滚的处理
	 */
	public void onTimeout() {
		throw new RuntimeException("Not implements!");
	}
	
}
